#pragma once
#include <QWidget>
#include "BondDetailData.h"
#include "BondDetailPrcFilterList.h"
#include "../../uam/UserAccountManager.h"
#include <map>
#include <QTimer>
class QVBoxLayout;
class QHBoxLayout;
class SCheckEx;

enum em_Check
{
	chk_Expire = 0,
	chk_SubType,
	chk_Grade,
	chk_Industry//行业
};

enum tabFiterType {
	RELEVANCEFILTERISSUER = 0, //同发行人
	RELEVANCEFILTERSECOND,	   //相似二级
	RELEVANCEFILTERFIRST,	   //相似一级
	RELEVENCECHECKNUMB	= 4
};

class BondDetailPrcRelevanceFilter : public QWidget
{
	Q_OBJECT
public:
    BondDetailPrcRelevanceFilter(QWidget* p, QSharedPointer<DetailData> data, tabFiterType fType);
	~BondDetailPrcRelevanceFilter();
	void refreshData();
protected:
	void reSetPrimaryRelevanceData();
	void delayReFilterData();
	void createList();
	void initialBroker();
	void reFilterData();
	int  buildSubType(); //CheckBox勾选类型

	QString	   getReComboxStr(int i);	
	SCheckEx* createCheckInfo(QString txt);
Q_SIGNALS:
	void filterBondSelected(std::string);
	void notifyDelayfilter(QList<QString>);
protected slots:
	void onClickCheckBox();
	void onGetSimilarBond(int ranKey);
	void onBondSelect(std::string bondKey);
private:
	QTimer*						m_reFltTime = nullptr;
    QSharedPointer<DetailData>  m_data = nullptr;
	std::vector<BrokerKey>		m_vctCurrentBondValid;
	std::vector<int>			m_vctCurrentBond;
	std::vector<SCheckEx*>		m_nCheckVector;
	QVBoxLayout*				m_mainLayout = nullptr;
	tabFiterType				m_nCurrentType;
	int							m_reCheckNumb = 4;
	std::map<int, CBrokerUnit>	m_mapBroker;
	BondDetailPrcFilterList*	m_list = nullptr;
	bool						m_bInitConnect= false;
};
	